package com.yan.service.impl;

import com.yan.service.DemoService;

/**
 * TODO
 *
 * @Author: 汪焰
 * @Date: 2021/5/26 21:08
 */
public class ProxyLog implements DemoService {

    private DemoService demoService;

    public ProxyLog(DemoService demoService) {
        this.demoService = demoService;
    }

    public String start(int age) {
        long startTime = System.currentTimeMillis();
        System.out.println("开始执行代理方法");
        String result = demoService.start(age);
        long time = System.currentTimeMillis() - startTime;
        System.out.println("执行方法耗时："+time);
        System.out.println("代理方法 执行结束");
        return result;
    }
}
